﻿namespace OffLineVoice
{
    /// <summary>
    /// 语音数据
    /// </summary>
    public interface ISpeakData
    {
        /// <summary>
        /// 当前命令类型
        /// </summary>
        CommandType CurrentCommand { get; }
    }

    /// <summary>
    /// 位移操作数据
    /// </summary>
    public struct OperatePathData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.OperatePath;

        /// <summary>
        /// 0：前进
        /// 1：后退
        /// </summary>
        public int OperatePath { get; }

        static OperatePathData() { }
        /// <summary>
        /// 0：前进
        /// 1：后退
        /// </summary>
        /// <param name="operatePath"></param>
        public OperatePathData(int operatePath)
        {
            OperatePath = operatePath;
        }
    }

    /// <summary>
    /// 牙齿选择数据
    /// </summary>
    public struct ToothSelectionData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.ToothSelection;

        /// <summary>
        /// 牙齿位置
        /// </summary>
        public int TeethPosition { get; }

        /// <summary>
        /// 是否唇侧
        /// </summary>
        public bool IsLabial { get; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="teethPosition"></param>
        /// <param name="isLabial">是否唇侧</param>
        public ToothSelectionData(int teethPosition, bool isLabial)
        {
            TeethPosition = teethPosition;
            IsLabial = isLabial;
        }
    }

    /// <summary>
    /// 牙位选择数据
    /// </summary>
    public struct DentalPositionSelectionData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.DentalPositionSelection;
        /// <summary>
        /// 0：近中
        /// 1：正中
        /// 2：远中
        /// </summary>
        public int Position { get; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="position">0：近中 1：正中 2：远中</param>
        public DentalPositionSelectionData(int position)
        {
            Position = position;
        }
    }

    /// <summary>
    /// 牙齿类型数据
    /// </summary>
    public struct ToothTypeData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.ToothType;

        /// <summary>
        /// 1：桥基牙
        /// 2：桥基牙种植
        /// 3：桥义齿
        /// 4：乳牙
        /// 5：牙冠
        /// 6：龋齿
        /// 7：阻生齿
        /// 8：种植体
        /// 9：缺失牙
        /// 10：恒牙
        /// </summary>
        public int ToothType { get; }

        public ToothTypeData(int toothType)
        {
            ToothType = toothType;
        }
    }

    /// <summary>
    /// 袋深数据
    /// </summary>
    public struct PocketDepthData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.PocketDepth;

        /// <summary>
        /// 袋深
        /// </summary>
        public int Depth { get; }
        public PocketDepthData(int depth)
        {
            Depth = depth;
        }
    }

    /// <summary>
    /// 退缩/增生数据
    /// </summary>
    public struct ShrinkageProliferationData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.ShrinkageProliferation;

        /// <summary>
        /// 0：退缩
        /// 1：增生
        /// </summary>
        public int Type { get; }

        /// <summary>
        /// 值
        /// </summary>
        public int Value { get; }
        public ShrinkageProliferationData(int type, int value)
        {
            Type = type;
            Value = value;
        }
    }

    /// <summary>
    /// 分叉数据
    /// </summary>
    public struct BifurcationData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.Bifurcation;

        /// <summary>
        /// 分叉值
        /// </summary>
        public int Value { get; }
        public BifurcationData(int value)
        {
            Value = value;
        }
    }

    /// <summary>
    /// 松动度数据
    /// </summary>
    public struct LoosenessData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.Looseness;

        /// <summary>
        /// 松动度
        /// </summary>
        public int Value { get; }
        public LoosenessData(int value)
        {
            Value = value;
        }
    }

    /// <summary>
    /// 症状数据
    /// </summary>
    public struct SymptomData : ISpeakData
    {
        public CommandType CurrentCommand { get; } = CommandType.Symptom;

        /// <summary>
        /// 1：菌斑
        /// 2：出血
        /// 3：化脓
        /// 4：出血化脓
        /// </summary>
        public int Type { get; }

        public SymptomData(int type)
        {
            Type = type;
        }
    }

    /// <summary>
    /// 语音命令类型
    /// </summary>
    public enum CommandType
    {
        /// <summary>
        /// 位移操作
        /// </summary>
        OperatePath = 1,

        /// <summary>
        /// 牙齿选择
        /// </summary>
        /// 

        ToothSelection = 2,
        /// <summary>
        /// 牙位选择
        /// </summary>
        DentalPositionSelection = 3,

        /// <summary>
        /// 牙齿类型
        /// </summary>
        ToothType = 4,

        /// <summary>
        /// 袋深
        /// </summary>
        PocketDepth = 5,

        /// <summary>
        /// 退缩/增生
        /// </summary>
        ShrinkageProliferation = 6,

        /// <summary>
        /// 分叉
        /// </summary>
        Bifurcation = 7,

        /// <summary>
        /// 松动度
        /// </summary>
        Looseness = 8,

        /// <summary>
        /// 松动度
        /// </summary>
        Symptom = 9
    }
}
